<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreateShopGoodsServiceTable extends Migrator
{
    /**
     * Migrate Up.
     */
    public function up()
    {
        $table = $this->table('shop_goods_service', ['comment' => '商品服务标签', 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci']);
        $table->addColumn('name', 'string', ['limit'  =>  120, 'null' => true, 'default' => null, 'comment' => '名称'])
            ->addColumn('image', 'string', ['limit' => 255, 'null' => true, 'default' => null, 'comment' => '服务标志'])
            ->addColumn('description', 'string', ['limit' => 255, 'null' => true, 'default' => null, 'comment' => '描述'])
            ->addColumn('create_time', 'integer', ['limit'  =>  10, 'null' => true, 'default' => null, 'comment' => '创建时间'])
            ->addColumn('update_time', 'integer', ['limit'  => 10, 'null' => true, 'default' => null, 'comment' => '更新时间'])
            ->create();
    }

    /**
     * Migrate Down.
     */
    public function down()
    {
        $table = $this->table('shop_goods_service');
        $table->drop();
    }
}
